package com.molichuxing.services.infrastructure.service;

import com.molichuxing.framework.service.RootService;
import com.molichuxing.services.infrastructure.dto.request.create.ContractEnterpriseCreateDto;
import com.molichuxing.services.infrastructure.dto.response.ContractEnterpriseDto;
import com.molichuxing.services.property.ContractEnterpriseTypeEnum;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 合同表 服务类
 * </p>
 *
 * @author zhaopenghui
 * @since
 */
public interface ContractEnterpriseService extends RootService {


    /**
     * 添加
     *
     * @param contractEnterpriseCreateDto
     * @return Integer 合同id
     * @throws Exception
     */
    public Integer createContract(ContractEnterpriseCreateDto contractEnterpriseCreateDto) throws Exception;

    /**
     * 添加订单号
     *
     * @param contractId 合同id
     * @param orderCode  订单号
     * @return
     */
    boolean modifyOrderCode(Integer contractId, Long orderCode);

    /**
     * 通过订单号，车辆id获取合同
     *
     * @param orderCode
     * @param carId
     * @param contractEnterpriseTypeEnum
     * @return
     */
    public ContractEnterpriseDto getContractByOrderCode(Long orderCode, Integer carId, ContractEnterpriseTypeEnum contractEnterpriseTypeEnum);

    /**
     * 通过订单号，车辆id获取合同
     *
     * @param orderCode
     * @param carId
     * @param contractEnterpriseTypeEnum
     * @return
     */
    public List<ContractEnterpriseDto> getContractListByOrderCode(Long orderCode, Integer carId, ContractEnterpriseTypeEnum contractEnterpriseTypeEnum);

    /**
     * 合同编号是否存在
     *
     * @return
     */
    public Boolean getContractNoExist(String contractNo);


    /**
     * 根据订单号获取
     *
     * @param orderCodes
     * @return
     */
    Map<Long, ContractEnterpriseDto> getContractMapByOrderCodes(List<Long> orderCodes);
}
